package com.slipper.system.codeless.bo;

import java.util.ArrayList;
import java.util.List;

import com.slipper.common.bo.CommonBO;
import com.slipper.constants.Constants;

/**
 * 数据字段信息表
 */
public class DataFieldBO extends CommonBO {
    public static final String FIELD_TYPE_VARCHAR = "字符";
    public static final String FIELD_TYPE_INTEGER = "整数";
    public static final String FIELD_TYPE_NUMERIC = "小数";
    public static final String FIELD_TYPE_DATETIME = "时间";
    public static final String FIELD_TYPE_RELATION = "联动";
    public static final String FIELD_TYPE_DERIVE = "派生";
    public static final String FIELD_TYPE_TEXT = "大文本";

    public static final String RELEVANCE_TYPE_MODEL = "数据模型";
    public static final String RELEVANCE_TYPE_AREA = "区划树";
    public static final String RELEVANCE_TYPE_UNIT = "单位树";
    public static final String RELEVANCE_TYPE_ENP = "企业树";
    public static final String RELEVANCE_TYPE_DEPT = "部门树";
    public static final String RELEVANCE_TYPE_EMP = "人员树";
    public static final String RELEVANCE_TYPE_DICT = "字典";

    public static final String ENUMERATE_TYPE_UNIT = "单位多选";
    public static final String ENUMERATE_TYPE_ENT = "企业多选";
    public static final String ENUMERATE_TYPE_DEPT = "部门多选";
    public static final String ENUMERATE_TYPE_EMP = "人员多选";
    public static final String ENUMERATE_TYPE_ROLE = "角色多选";
    public static final String ENUMERATE_TYPE_MULTI = "多选框";
    public static final String ENUMERATE_TYPE_MULTI_DOWN = "多选下拉框";

    /* 主键ID */
    private String id;
    /* 主键ID */
    private String[] ids;
    /* 模型ID */
    private String modelId;
    private String[] modelIds;
    /* 字段名称 */
    private String fieldName;
    /* 显示名称 */
    private String showName;
    /* 是否主键 */
    private String primaryKey;
    /* 是否必填 */
    private String required;
    /* 字段类型： 字符、整数、小数、日期、时间、图片、视频、附件、联动、大文本 */
    private String fieldType;
    /* 字段长度 */
    private Integer fieldSize;
    /* 字段精度 */
    private Integer fieldPrecision;
    private String autoCreate;
    private String autoSequenceId;
    private String autoSequenceName;
    private String nativeFieldId;
    private String nativeFieldName;
    private String sourceFieldId;
    /* 默认值 */
    private String defaultValue;
    /* 是否枚举 */
    private String enumerate;
    /* 枚举选择类型： 1、单选框 2、下拉框 */
    private String enumerateType;
    /* 枚举值 */
    private String enumerateValue;
    /* 联动类型：数据模型、字典 */
    private String relevanceType;
    /* 联动字典 */
    private String relevanceDict;
    /* 格式化 */
    private String format;
    /* 最大值 */
    private Integer maxValue;
    /* 最小值 */
    private Integer minValue;
    /* 不包含最大值 */
    private String containMaxValue;
    /* 不包含最小值 */
    private String containMinValue;
    /* 文本框类型： 1、单行文本框 2、多行文本框 3、富文本框 */
    private String inputType;
    /* 多行文本行数 */
    private Integer rowLine;
    /* 输入框前置内容 */
    private String prefixText;
    /* 输入框后置内容 */
    private String suffixText;
    /* 是否去前后空格 */
    private String trimBlank;
    /* 可否手绘 */
    private String handDraw;
    /* 图片样式： 1、长方形 2、圆形 */
    private String imageStyle;
    /* 图片高度 */
    private Integer imageHeight;
    /* 图片宽度 */
    private Integer imageWidth;
    /* 图片数量限制 */
    private Integer imageLimit;
    /* 图片大小限制，单位为：M */
    private Integer imageMaxSize;
    /* 描述 */
    private String description;
    /* 排序 */
    private Integer ordinal;
    /* 内置字段 */
    private String builtin;
    /* 更新人ID */
    private String updateId;
    /* 更新时间 */
    private Long updateTime;
    /* 创建人ID */
    private String createId;
    /* 创建时间 */
    private Long createTime;

    private Integer fieldFlag;

    private List<DataFieldRelevanceBO> relevanceList = new ArrayList<>();

    public DataFieldBO() {}

    public DataFieldBO(
            String fieldName,
            String showName,
            String primaryKey,
            String fieldType,
            Integer fieldSize,
            Integer ordinal) {
        this.setFieldName(fieldName);
        this.setShowName(showName);
        this.setPrimaryKey(primaryKey);
        this.setRequired(Constants.NO);
        this.setFieldType(fieldType);
        this.setFieldSize(fieldSize);
        this.setOrdinal(ordinal);
        this.setBuiltin(Constants.YES);
    }

    public void setId(String id) {
        this.id = id;
    }
    
    public String getId() {
        return id;
    }

    public void setIds(String[] ids) {
        this.ids = ids;
    }
    
    public String[] getIds() {
        return ids;
    }

    public void setModelId(String modelId) {
        this.modelId = modelId;
    }
    
    public String getModelId() {
        return modelId;
    }

    public String[] getModelIds() {
        return modelIds;
    }

    public void setModelIds(String[] modelIds) {
        this.modelIds = modelIds;
    }

    public void setFieldName(String fieldName) {
        this.fieldName = fieldName;
    }
    
    public String getFieldName() {
        return fieldName;
    }

    public void setShowName(String showName) {
        this.showName = showName;
    }
    
    public String getShowName() {
        return showName;
    }

    public void setPrimaryKey(String primaryKey) {
        this.primaryKey = primaryKey;
    }
    
    public String getPrimaryKey() {
        return primaryKey;
    }

    public String getRequired() {
        return required;
    }

    public void setRequired(String required) {
        this.required = required;
    }

    public void setFieldType(String fieldType) {
        this.fieldType = fieldType;
    }
    
    public String getFieldType() {
        return fieldType;
    }

    public void setFieldSize(Integer fieldSize) {
        this.fieldSize = fieldSize;
    }
    
    public Integer getFieldSize() {
        return fieldSize;
    }

    public void setFieldPrecision(Integer fieldPrecision) {
        this.fieldPrecision = fieldPrecision;
    }
    
    public Integer getFieldPrecision() {
        return fieldPrecision;
    }

    public String getAutoCreate() {
        return autoCreate;
    }

    public void setAutoCreate(String autoCreate) {
        this.autoCreate = autoCreate;
    }

    public String getAutoSequenceId() {
        return autoSequenceId;
    }

    public void setAutoSequenceId(String autoSequenceId) {
        this.autoSequenceId = autoSequenceId;
    }

    public String getAutoSequenceName() {
        return autoSequenceName;
    }

    public void setAutoSequenceName(String autoSequenceName) {
        this.autoSequenceName = autoSequenceName;
    }

    public String getNativeFieldId() {
        return nativeFieldId;
    }

    public void setNativeFieldId(String nativeFieldId) {
        this.nativeFieldId = nativeFieldId;
    }

    public String getNativeFieldName() {
        return nativeFieldName;
    }

    public void setNativeFieldName(String nativeFieldName) {
        this.nativeFieldName = nativeFieldName;
    }

    public String getSourceFieldId() {
        return sourceFieldId;
    }

    public void setSourceFieldId(String sourceFieldId) {
        this.sourceFieldId = sourceFieldId;
    }

    public void setDefaultValue(String defaultValue) {
        this.defaultValue = defaultValue;
    }
    
    public String getDefaultValue() {
        return defaultValue;
    }

    public void setEnumerate(String enumerate) {
        this.enumerate = enumerate;
    }
    
    public String getEnumerate() {
        return enumerate;
    }

    public String getEnumerateType() {
        return enumerateType;
    }

    public void setEnumerateType(String enumerateType) {
        this.enumerateType = enumerateType;
    }

    public void setEnumerateValue(String enumerateValue) {
        this.enumerateValue = enumerateValue;
    }
    
    public String getEnumerateValue() {
        return enumerateValue;
    }

    public String getRelevanceType() {
        return relevanceType;
    }

    public void setRelevanceType(String relevanceType) {
        this.relevanceType = relevanceType;
    }

    public String getRelevanceDict() {
        return relevanceDict;
    }

    public void setRelevanceDict(String relevanceDict) {
        this.relevanceDict = relevanceDict;
    }

    public String getFormat() {
        return format;
    }

    public void setFormat(String format) {
        this.format = format;
    }

    public void setMaxValue(Integer maxValue) {
        this.maxValue = maxValue;
    }
    
    public Integer getMaxValue() {
        return maxValue;
    }

    public void setMinValue(Integer minValue) {
        this.minValue = minValue;
    }
    
    public Integer getMinValue() {
        return minValue;
    }

    public void setContainMaxValue(String containMaxValue) {
        this.containMaxValue = containMaxValue;
    }
    
    public String getContainMaxValue() {
        return containMaxValue;
    }

    public void setContainMinValue(String containMinValue) {
        this.containMinValue = containMinValue;
    }
    
    public String getContainMinValue() {
        return containMinValue;
    }

    public void setInputType(String inputType) {
        this.inputType = inputType;
    }
    
    public String getInputType() {
        return inputType;
    }

    public Integer getRowLine() {
        return rowLine;
    }

    public void setRowLine(Integer rowLine) {
        this.rowLine = rowLine;
    }

    public String getPrefixText() {
        return prefixText;
    }

    public void setPrefixText(String prefixText) {
        this.prefixText = prefixText;
    }

    public String getSuffixText() {
        return suffixText;
    }

    public void setSuffixText(String suffixText) {
        this.suffixText = suffixText;
    }

    public void setTrimBlank(String trimBlank) {
        this.trimBlank = trimBlank;
    }
    
    public String getTrimBlank() {
        return trimBlank;
    }

    public String getHandDraw() {
        return handDraw;
    }

    public void setHandDraw(String handDraw) {
        this.handDraw = handDraw;
    }

    public void setImageStyle(String imageStyle) {
        this.imageStyle = imageStyle;
    }
    
    public String getImageStyle() {
        return imageStyle;
    }

    public void setImageHeight(Integer imageHeight) {
        this.imageHeight = imageHeight;
    }
    
    public Integer getImageHeight() {
        return imageHeight;
    }

    public void setImageWidth(Integer imageWidth) {
        this.imageWidth = imageWidth;
    }
    
    public Integer getImageWidth() {
        return imageWidth;
    }

    public void setImageLimit(Integer imageLimit) {
        this.imageLimit = imageLimit;
    }
    
    public Integer getImageLimit() {
        return imageLimit;
    }

    public void setImageMaxSize(Integer imageMaxSize) {
        this.imageMaxSize = imageMaxSize;
    }
    
    public Integer getImageMaxSize() {
        return imageMaxSize;
    }

    public void setDescription(String description) {
        this.description = description;
    }
    
    public String getDescription() {
        return description;
    }

    public Integer getOrdinal() {
        return ordinal;
    }

    public void setOrdinal(Integer ordinal) {
        this.ordinal = ordinal;
    }

    public String getBuiltin() {
        return builtin;
    }

    public void setBuiltin(String builtin) {
        this.builtin = builtin;
    }

    public void setUpdateId(String updateId) {
        this.updateId = updateId;
    }
    
    public String getUpdateId() {
        return updateId;
    }

    public void setUpdateTime(Long updateTime) {
        this.updateTime = updateTime;
    }
    
    public Long getUpdateTime() {
        return updateTime;
    }

    public void setCreateId(String createId) {
        this.createId = createId;
    }
    
    public String getCreateId() {
        return createId;
    }

    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }
    
    public Long getCreateTime() {
        return createTime;
    }

    public Integer getFieldFlag() {
        return fieldFlag;
    }

    public void setFieldFlag(Integer fieldFlag) {
        this.fieldFlag = fieldFlag;
    }

    public List<DataFieldRelevanceBO> getRelevanceList() {
        return relevanceList;
    }

    public void setRelevanceList(List<DataFieldRelevanceBO> relevanceList) {
        this.relevanceList = relevanceList;
    }

    public DataFieldBO cloneValue(String modelId) {
        DataFieldBO clone = new DataFieldBO();
        clone.id = this.id;
        clone.ids = this.ids;
        clone.modelId = modelId;
        clone.fieldName = this.fieldName;
        clone.showName = this.showName;
        clone.primaryKey = this.primaryKey;
        clone.required = this.required;
        clone.fieldType = this.fieldType;
        clone.fieldSize = this.fieldSize;
        clone.fieldPrecision = this.fieldPrecision;
        clone.autoCreate = this.autoCreate;
        clone.autoSequenceId = this.autoSequenceId;
        clone.nativeFieldId = this.nativeFieldId;
        clone.sourceFieldId = this.sourceFieldId;
        clone.defaultValue = this.defaultValue;
        clone.enumerate = this.enumerate;
        clone.enumerateType = this.enumerateType;
        clone.enumerateValue = this.enumerateValue;
        clone.relevanceType = this.relevanceType;
        clone.relevanceDict = this.relevanceDict;
        clone.maxValue = this.maxValue;
        clone.minValue = this.minValue;
        clone.containMaxValue = this.containMaxValue;
        clone.containMinValue = this.containMinValue;
        clone.inputType = this.inputType;
        clone.rowLine = this.rowLine;
        clone.prefixText = this.prefixText;
        clone.suffixText = this.suffixText;
        clone.trimBlank = this.trimBlank;
        clone.handDraw = this.handDraw;
        clone.imageStyle = this.imageStyle;
        clone.imageHeight = this.imageHeight;
        clone.imageWidth = this.imageWidth;
        clone.imageLimit = this.imageLimit;
        clone.imageMaxSize = this.imageMaxSize;
        clone.description = this.description;
        clone.ordinal = this.ordinal;
        clone.builtin = this.builtin;
        clone.updateId = this.updateId;
        clone.updateTime = this.updateTime;
        clone.createId = this.createId;
        clone.createTime = this.createTime;
        return clone;
    }
}
